package gengine.clientside;

import gengine.common.misc.BaseClientThread;
import gengine.common.packets.BasePacket;
import gengine.common.packets.PacketTypeEnum;

import java.io.IOException;
import java.net.Socket;

/**
 * User: arseniy
 * Date: 21.12.11
 */
public class ClientThread extends BaseClientThread{
    
    ClientApplication app;

    public ClientThread(Socket socket, ClientApplication app) throws IOException {
        super(socket,0);
        this.app = app;
    }

    @Override
    protected void ProcessPacket(BasePacket packet) {
        PacketTypeEnum type = packet.getPacketType();
        if (type==PacketTypeEnum.ServerInitPacket)
            id = packet.getClientId();
        app.processPacket(packet);
    }

}
